using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: daiduong19051986@gmail.com 
	/// <summary>
	
    public class TVC_RFITMInfo
    {
		#region Local Variable
		public enum Field
		{
			ItemCode,
			Description,
			ShortDescription,
			UOM,
			Category,
			BudgetCode,
			BudgetYear,
			PurchaseAccount,
			AccrualAccount,
			isLink,
			Note1,
			Note2,
			Note3,
			Department,
			Ave_Cost,
			MINSTOCK,
			MAXSTOCK,
			ANAL_I0,
			ANAL_I1,
			ANAL_I2,
			ANAL_I3,
			ANAL_I4,
			ANAL_I5,
			ANAL_I6,
			ANAL_I7,
			ANAL_I8,
			ANAL_I9
		}
		private String _ItemCode;
		private String _Description;
		private String _ShortDescription;
		private String _UOM;
		private String _Category;
		private String _BudgetCode;
		private Int16 _BudgetYear;
		private String _PurchaseAccount;
		private String _AccrualAccount;
		private Int16 _isLink;
		private String _Note1;
		private String _Note2;
		private String _Note3;
		private String _Department;
		private Double _Ave_Cost;
		private Double _MINSTOCK;
		private Double _MAXSTOCK;
		private String _ANAL_I0;
		private String _ANAL_I1;
		private String _ANAL_I2;
		private String _ANAL_I3;
		private String _ANAL_I4;
		private String _ANAL_I5;
		private String _ANAL_I6;
		private String _ANAL_I7;
		private String _ANAL_I8;
		private String _ANAL_I9;
		
		public String ItemCode{	get{ return _ItemCode;} set{_ItemCode = value;} }
		public String Description{	get{ return _Description;} set{_Description = value;} }
		public String ShortDescription{	get{ return _ShortDescription;} set{_ShortDescription = value;} }
		public String UOM{	get{ return _UOM;} set{_UOM = value;} }
		public String Category{	get{ return _Category;} set{_Category = value;} }
		public String BudgetCode{	get{ return _BudgetCode;} set{_BudgetCode = value;} }
		public Int16 BudgetYear{	get{ return _BudgetYear;} set{_BudgetYear = value;} }
		public String PurchaseAccount{	get{ return _PurchaseAccount;} set{_PurchaseAccount = value;} }
		public String AccrualAccount{	get{ return _AccrualAccount;} set{_AccrualAccount = value;} }
		public Int16 isLink{	get{ return _isLink;} set{_isLink = value;} }
		public String Note1{	get{ return _Note1;} set{_Note1 = value;} }
		public String Note2{	get{ return _Note2;} set{_Note2 = value;} }
		public String Note3{	get{ return _Note3;} set{_Note3 = value;} }
		public String Department{	get{ return _Department;} set{_Department = value;} }
		public Double Ave_Cost{	get{ return _Ave_Cost;} set{_Ave_Cost = value;} }
		public Double MINSTOCK{	get{ return _MINSTOCK;} set{_MINSTOCK = value;} }
		public Double MAXSTOCK{	get{ return _MAXSTOCK;} set{_MAXSTOCK = value;} }
		public String ANAL_I0{	get{ return _ANAL_I0;} set{_ANAL_I0 = value;} }
		public String ANAL_I1{	get{ return _ANAL_I1;} set{_ANAL_I1 = value;} }
		public String ANAL_I2{	get{ return _ANAL_I2;} set{_ANAL_I2 = value;} }
		public String ANAL_I3{	get{ return _ANAL_I3;} set{_ANAL_I3 = value;} }
		public String ANAL_I4{	get{ return _ANAL_I4;} set{_ANAL_I4 = value;} }
		public String ANAL_I5{	get{ return _ANAL_I5;} set{_ANAL_I5 = value;} }
		public String ANAL_I6{	get{ return _ANAL_I6;} set{_ANAL_I6 = value;} }
		public String ANAL_I7{	get{ return _ANAL_I7;} set{_ANAL_I7 = value;} }
		public String ANAL_I8{	get{ return _ANAL_I8;} set{_ANAL_I8 = value;} }
		public String ANAL_I9{	get{ return _ANAL_I9;} set{_ANAL_I9 = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public TVC_RFITMInfo()
		{
			_ItemCode = "";
			_Description = "";
			_ShortDescription = "";
			_UOM = "";
			_Category = "";
			_BudgetCode = "";
			_BudgetYear = (Int16)0;
			_PurchaseAccount = "";
			_AccrualAccount = "";
			_isLink = (Int16)0;
			_Note1 = "";
			_Note2 = "";
			_Note3 = "";
			_Department = "";
			_Ave_Cost = 0;
			_MINSTOCK = 0;
			_MAXSTOCK = 0;
			_ANAL_I0 = "";
			_ANAL_I1 = "";
			_ANAL_I2 = "";
			_ANAL_I3 = "";
			_ANAL_I4 = "";
			_ANAL_I5 = "";
			_ANAL_I6 = "";
			_ANAL_I7 = "";
			_ANAL_I8 = "";
			_ANAL_I9 = "";
		}
		public TVC_RFITMInfo(
		String ItemCode,
		String Description,
		String ShortDescription,
		String UOM,
		String Category,
		String BudgetCode,
		Int16 BudgetYear,
		String PurchaseAccount,
		String AccrualAccount,
		Int16 isLink,
		String Note1,
		String Note2,
		String Note3,
		String Department,
		Double Ave_Cost,
		Double MINSTOCK,
		Double MAXSTOCK,
		String ANAL_I0,
		String ANAL_I1,
		String ANAL_I2,
		String ANAL_I3,
		String ANAL_I4,
		String ANAL_I5,
		String ANAL_I6,
		String ANAL_I7,
		String ANAL_I8,
		String ANAL_I9
		)
		{
			_ItemCode = ItemCode;
			_Description = Description;
			_ShortDescription = ShortDescription;
			_UOM = UOM;
			_Category = Category;
			_BudgetCode = BudgetCode;
			_BudgetYear = BudgetYear;
			_PurchaseAccount = PurchaseAccount;
			_AccrualAccount = AccrualAccount;
			_isLink = isLink;
			_Note1 = Note1;
			_Note2 = Note2;
			_Note3 = Note3;
			_Department = Department;
			_Ave_Cost = Ave_Cost;
			_MINSTOCK = MINSTOCK;
			_MAXSTOCK = MAXSTOCK;
			_ANAL_I0 = ANAL_I0;
			_ANAL_I1 = ANAL_I1;
			_ANAL_I2 = ANAL_I2;
			_ANAL_I3 = ANAL_I3;
			_ANAL_I4 = ANAL_I4;
			_ANAL_I5 = ANAL_I5;
			_ANAL_I6 = ANAL_I6;
			_ANAL_I7 = ANAL_I7;
			_ANAL_I8 = ANAL_I8;
			_ANAL_I9 = ANAL_I9;
		}
		public TVC_RFITMInfo(DataRow dr)
		{
			if (dr != null)
			{
				_ItemCode = dr[Field.ItemCode.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ItemCode.ToString()]);
				_Description = dr[Field.Description.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Description.ToString()]);
				_ShortDescription = dr[Field.ShortDescription.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ShortDescription.ToString()]);
				_UOM = dr[Field.UOM.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.UOM.ToString()]);
				_Category = dr[Field.Category.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Category.ToString()]);
				_BudgetCode = dr[Field.BudgetCode.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.BudgetCode.ToString()]);
				_BudgetYear = dr[Field.BudgetYear.ToString()] == DBNull.Value?(Int16)0:Convert.ToInt16(dr[Field.BudgetYear.ToString()]);
				_PurchaseAccount = dr[Field.PurchaseAccount.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.PurchaseAccount.ToString()]);
				_AccrualAccount = dr[Field.AccrualAccount.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.AccrualAccount.ToString()]);
				_isLink = dr[Field.isLink.ToString()] == DBNull.Value?(Int16)0:Convert.ToInt16(dr[Field.isLink.ToString()]);
				_Note1 = dr[Field.Note1.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Note1.ToString()]);
				_Note2 = dr[Field.Note2.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Note2.ToString()]);
				_Note3 = dr[Field.Note3.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Note3.ToString()]);
				_Department = dr[Field.Department.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Department.ToString()]);
				_Ave_Cost = dr[Field.Ave_Cost.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.Ave_Cost.ToString()]);
				_MINSTOCK = dr[Field.MINSTOCK.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.MINSTOCK.ToString()]);
				_MAXSTOCK = dr[Field.MAXSTOCK.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.MAXSTOCK.ToString()]);
				_ANAL_I0 = dr[Field.ANAL_I0.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I0.ToString()]);
				_ANAL_I1 = dr[Field.ANAL_I1.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I1.ToString()]);
				_ANAL_I2 = dr[Field.ANAL_I2.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I2.ToString()]);
				_ANAL_I3 = dr[Field.ANAL_I3.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I3.ToString()]);
				_ANAL_I4 = dr[Field.ANAL_I4.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I4.ToString()]);
				_ANAL_I5 = dr[Field.ANAL_I5.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I5.ToString()]);
				_ANAL_I6 = dr[Field.ANAL_I6.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I6.ToString()]);
				_ANAL_I7 = dr[Field.ANAL_I7.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I7.ToString()]);
				_ANAL_I8 = dr[Field.ANAL_I8.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I8.ToString()]);
				_ANAL_I9 = dr[Field.ANAL_I9.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I9.ToString()]);
			}
		}
		public TVC_RFITMInfo(DataRowView dr)
		{
			if (dr != null)
			{
				_ItemCode = dr[Field.ItemCode.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ItemCode.ToString()]);
				_Description = dr[Field.Description.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Description.ToString()]);
				_ShortDescription = dr[Field.ShortDescription.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ShortDescription.ToString()]);
				_UOM = dr[Field.UOM.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.UOM.ToString()]);
				_Category = dr[Field.Category.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Category.ToString()]);
				_BudgetCode = dr[Field.BudgetCode.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.BudgetCode.ToString()]);
				_BudgetYear = dr[Field.BudgetYear.ToString()] == DBNull.Value?(Int16)0:Convert.ToInt16(dr[Field.BudgetYear.ToString()]);
				_PurchaseAccount = dr[Field.PurchaseAccount.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.PurchaseAccount.ToString()]);
				_AccrualAccount = dr[Field.AccrualAccount.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.AccrualAccount.ToString()]);
				_isLink = dr[Field.isLink.ToString()] == DBNull.Value?(Int16)0:Convert.ToInt16(dr[Field.isLink.ToString()]);
				_Note1 = dr[Field.Note1.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Note1.ToString()]);
				_Note2 = dr[Field.Note2.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Note2.ToString()]);
				_Note3 = dr[Field.Note3.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Note3.ToString()]);
				_Department = dr[Field.Department.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.Department.ToString()]);
				_Ave_Cost = dr[Field.Ave_Cost.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.Ave_Cost.ToString()]);
				_MINSTOCK = dr[Field.MINSTOCK.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.MINSTOCK.ToString()]);
				_MAXSTOCK = dr[Field.MAXSTOCK.ToString()] == DBNull.Value?0:Convert.ToDouble(dr[Field.MAXSTOCK.ToString()]);
				_ANAL_I0 = dr[Field.ANAL_I0.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I0.ToString()]);
				_ANAL_I1 = dr[Field.ANAL_I1.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I1.ToString()]);
				_ANAL_I2 = dr[Field.ANAL_I2.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I2.ToString()]);
				_ANAL_I3 = dr[Field.ANAL_I3.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I3.ToString()]);
				_ANAL_I4 = dr[Field.ANAL_I4.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I4.ToString()]);
				_ANAL_I5 = dr[Field.ANAL_I5.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I5.ToString()]);
				_ANAL_I6 = dr[Field.ANAL_I6.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I6.ToString()]);
				_ANAL_I7 = dr[Field.ANAL_I7.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I7.ToString()]);
				_ANAL_I8 = dr[Field.ANAL_I8.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I8.ToString()]);
				_ANAL_I9 = dr[Field.ANAL_I9.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.ANAL_I9.ToString()]);
			}
		}
		public TVC_RFITMInfo(TVC_RFITMInfo objEntr)
		{			
			_ItemCode = objEntr.ItemCode;			
			_Description = objEntr.Description;			
			_ShortDescription = objEntr.ShortDescription;			
			_UOM = objEntr.UOM;			
			_Category = objEntr.Category;			
			_BudgetCode = objEntr.BudgetCode;			
			_BudgetYear = objEntr.BudgetYear;			
			_PurchaseAccount = objEntr.PurchaseAccount;			
			_AccrualAccount = objEntr.AccrualAccount;			
			_isLink = objEntr.isLink;			
			_Note1 = objEntr.Note1;			
			_Note2 = objEntr.Note2;			
			_Note3 = objEntr.Note3;			
			_Department = objEntr.Department;			
			_Ave_Cost = objEntr.Ave_Cost;			
			_MINSTOCK = objEntr.MINSTOCK;			
			_MAXSTOCK = objEntr.MAXSTOCK;			
			_ANAL_I0 = objEntr.ANAL_I0;			
			_ANAL_I1 = objEntr.ANAL_I1;			
			_ANAL_I2 = objEntr.ANAL_I2;			
			_ANAL_I3 = objEntr.ANAL_I3;			
			_ANAL_I4 = objEntr.ANAL_I4;			
			_ANAL_I5 = objEntr.ANAL_I5;			
			_ANAL_I6 = objEntr.ANAL_I6;			
			_ANAL_I7 = objEntr.ANAL_I7;			
			_ANAL_I8 = objEntr.ANAL_I8;			
			_ANAL_I9 = objEntr.ANAL_I9;			
		}
        #endregion Constructor
        
        #region InitTable
        public static DataTable ToDataTable()
		{
			DataTable dt = new DataTable("TVC_RFITM");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.ItemCode.ToString(), typeof(String)),
				new DataColumn(Field.Description.ToString(), typeof(String)),
				new DataColumn(Field.ShortDescription.ToString(), typeof(String)),
				new DataColumn(Field.UOM.ToString(), typeof(String)),
				new DataColumn(Field.Category.ToString(), typeof(String)),
				new DataColumn(Field.BudgetCode.ToString(), typeof(String)),
				new DataColumn(Field.BudgetYear.ToString(), typeof(Int16)),
				new DataColumn(Field.PurchaseAccount.ToString(), typeof(String)),
				new DataColumn(Field.AccrualAccount.ToString(), typeof(String)),
				new DataColumn(Field.isLink.ToString(), typeof(Int16)),
				new DataColumn(Field.Note1.ToString(), typeof(String)),
				new DataColumn(Field.Note2.ToString(), typeof(String)),
				new DataColumn(Field.Note3.ToString(), typeof(String)),
				new DataColumn(Field.Department.ToString(), typeof(String)),
				new DataColumn(Field.Ave_Cost.ToString(), typeof(Double)),
				new DataColumn(Field.MINSTOCK.ToString(), typeof(Double)),
				new DataColumn(Field.MAXSTOCK.ToString(), typeof(Double)),
				new DataColumn(Field.ANAL_I0.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I1.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I2.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I3.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I4.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I5.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I6.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I7.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I8.ToString(), typeof(String)),
				new DataColumn(Field.ANAL_I9.ToString(), typeof(String))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.ItemCode.ToString()] = _ItemCode;
			row[Field.Description.ToString()] = _Description;
			row[Field.ShortDescription.ToString()] = _ShortDescription;
			row[Field.UOM.ToString()] = _UOM;
			row[Field.Category.ToString()] = _Category;
			row[Field.BudgetCode.ToString()] = _BudgetCode;
			row[Field.BudgetYear.ToString()] = _BudgetYear;
			row[Field.PurchaseAccount.ToString()] = _PurchaseAccount;
			row[Field.AccrualAccount.ToString()] = _AccrualAccount;
			row[Field.isLink.ToString()] = _isLink;
			row[Field.Note1.ToString()] = _Note1;
			row[Field.Note2.ToString()] = _Note2;
			row[Field.Note3.ToString()] = _Note3;
			row[Field.Department.ToString()] = _Department;
			row[Field.Ave_Cost.ToString()] = _Ave_Cost;
			row[Field.MINSTOCK.ToString()] = _MINSTOCK;
			row[Field.MAXSTOCK.ToString()] = _MAXSTOCK;
			row[Field.ANAL_I0.ToString()] = _ANAL_I0;
			row[Field.ANAL_I1.ToString()] = _ANAL_I1;
			row[Field.ANAL_I2.ToString()] = _ANAL_I2;
			row[Field.ANAL_I3.ToString()] = _ANAL_I3;
			row[Field.ANAL_I4.ToString()] = _ANAL_I4;
			row[Field.ANAL_I5.ToString()] = _ANAL_I5;
			row[Field.ANAL_I6.ToString()] = _ANAL_I6;
			row[Field.ANAL_I7.ToString()] = _ANAL_I7;
			row[Field.ANAL_I8.ToString()] = _ANAL_I8;
			row[Field.ANAL_I9.ToString()] = _ANAL_I9;
			return row;
		}
        #endregion InitTable
    }
}
